/**
 * @author roua_troua
 */


package q10.Arbori;

import q10.Visitor.*;

public class Nod{

	/**
	 * variabile membre
	 * - nodul stang: fStang
	 * - nodul drept: fDrept
	 * - valoarea lui x
	 */
	protected Nod fStang,fDrept;
	protected double x; 
	protected String sNume;
	/**
	 * @param
	 * @return nodul Stang
	 */
	public Nod getfStang() 
	{
		return fStang;
	}
	
	/**
	 * @param fStang Nod 
	 * @return
	 */
	
	public void setfStang(Nod fStang) 
	{
		this.fStang = fStang;
	}
	
	/**
	 * @param
	 * @return nodul Drept
	 */
	
	public Nod getfDrept() 
	{
		return fDrept;
	}
	
	/**
	 * @param fDrept Nod
	 * @return
	 */
	public void setfDrept(Nod fDrept) 
	{
		this.fDrept = fDrept;
	}
	
	/**
	 * @param 
	 * @return double x
	 */
	public double getX() 
	{
		return x;
	}
	
	/**
	 * @param double x
	 * @return
	 */
	
	public void setX(double x) 
	{
		this.x = x;
		
		if(this.getfDrept()!=null)
			this.fDrept.setX(x);
		if(this.getfStang()!=null)
			this.fStang.setX(x);
	}
	/**
	 * 
	 * @param s
	 */
	public void setNume(String s){
		this.sNume = s;
	}
	
	/**
	 * 
	 * @return
	 */
	public String getNume(){
		return sNume;
	}
	
	/**
	 * @param Visitor v
	 * @return
	 */
	public void acceptVisitor(Visitor v){
		v.visit(this);
	}
}
